package org.tigr.htc.persist;

/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

import java.util.List;
import java.util.Vector;

import org.exolab.castor.persist.spi.Complex;

/**
 * The interface <b>IPersist</b>
 *
 */
public interface IPersist {
	
    /**
     * The method <code>getNewID<code>
     *
     * @return
     *
     */
    public long getNewID();

    /**
     * The method <code>persistObject<code>
     *
     * @param pCmd
     *
     */
    public void create(Object p_cmd);

    /**
     * The method <code>updateObject<code>
     *
     * @param pCmd
     *
     */
    public void update(Object pCmd);

    /**
     * The method <code>findObject<code>
     *
     * @param pId
     * @param pClass
     * 
     * @return an <code>Object</code>
     */
    public Object find(long pId, Class pClass);

    /**
     * The method <code>findObject<code>
     *
     * @param pId
     * @param pClass
     * 
     * @return
     */
    public Object find(Complex pId, Class pClass);

    /**
     * The method <code>removeObject<code>
     *
     * @param pId
     * @param pClass
     */
    public void delete(long pId, Class pClass);

    /**
     * The method <code>searchObjects<code>
     *
     * @param pWhere
     * @param pOrder
     * @param pLimit
     *
     * @return
     */
    public List searchCommands(String pWhere, String pOrder, String pLimit);

    public Integer countCommands(String pWhere);
    
    public Vector retrieveTasks(long pID);
}
